<?php 
function checkPost(array $arr)
{
    $sign = true;
    foreach ($arr as $value) {
        if (!isset($value) && empty($value)) {
            $sign = false;
            break;
        }
    }
    return $sign;
}

/**
* 系统邮件发送函数
* @param string $mailto    接收邮件者邮箱
* @param string $subject 邮件主题 
* @param string $body    邮件内容
* @return boolean 
*/
function sendmail($mailto, $subject, $body)
{
    import('ORG.Email');//导入本类
    $data['mailto']  =   $mailto; //收件人
    $data['subject'] =   $subject;    //邮件标题
    $data['body']    =   $body;    //邮件正文内容
    $mail = new Email();
    print_r($data);
    if($mail->send($data))
        return true;
    else
        return false;
}

/*
 * 获取用户IP的函数
 */
function getIp(){
    if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) 
        $ip = getenv("HTTP_CLIENT_IP"); 
    else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) 
        $ip = getenv("HTTP_X_FORWARDED_FOR"); 
    else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) 
        $ip = getenv("REMOTE_ADDR"); 
    else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) 
        $ip = $_SERVER['REMOTE_ADDR']; 
    else
        $ip = "unknown"; 
    return($ip); 
}


 ?>